package com.example.login.model

import com.example.common.model.BaseRepository
import com.example.login.api.LoginApiServer
import com.example.login.entity.LoginResultEntity
import com.example.net.HttpInterceptorType
import okhttp3.RequestBody
import okhttp3.ResponseBody

class LoginRepository:BaseRepository<LoginApiServer>() {

    suspend fun loginToServer(body: RequestBody): LoginResultEntity {
        return createApiServer(LoginApiServer::class.java, HttpInterceptorType.SIGN).loginToServer(body)
    }

    /**
     * 注册账号
     */
    suspend fun registerToServer(body:RequestBody): LoginResultEntity{
        return createApiServer(LoginApiServer::class.java, HttpInterceptorType.SIGN).registerToServer(body)
    }
}